/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       glfloader.h
 * Author:     karooolek
 * Created on: 2009-03-24
 *
 **********************************************************************************************************************/

#ifndef GLFLOADER_H_
#define GLFLOADER_H_

#include "fontloader.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * GLF file font loader.
 */
class GLFLoader : public FontLoader
{
private:
    // glf file structures
    struct GLFontChar
    {
        float dx, dy;
        float tx1, ty1;
        float tx2, ty2;
    };

    struct GLFHeader
    {
        int tex;
        int tex_width, tex_height;
        int start_char, end_char;
        GLFontChar *chars;
    };

public:
    /**
     * Create GLF font loader with no file name specified.
     */
    GLFLoader();

    /**
     * Create GLF font loader with specified file name.
     * @return filename GLF font file name to load
     */
    GLFLoader(const String &filename);

    /**
     * Destroy GLF font file loader.
     * @return
     */
    ~GLFLoader();

    /**
     * Load font from GLF file.
     */
    void load();

    /**
     * Unload font.
     */
    void unload();
};

}
}

#endif // GLFLOADER_H_
